package com.tiancheng.trade.payment.channel.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Author: kellen
 * @Description:
 * @Date: create in 2024/11/22 09:58
 */
@Getter
@AllArgsConstructor
public enum SettlePatternEnum {
    not_settle(0,"不分账"),
    payment_settle(1,"支付时分账"),
    zgxt_settle(2,"资金管理系统分账");

    private final Integer code;
    private final String desc;

    public static Optional<SettlePatternEnum> getByCode(Integer code) {
        return Arrays.stream(SettlePatternEnum.values()).filter(c -> c.code.equals(code)).findFirst();
    }

}
